/* eslint-disable import/no-duplicates */
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/components/layout/index.vue'
import { menuRoutes } from './menuRouter'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'login',
    component: { render() { return 'login' } }
  },
  {
    path: '/404',
    name: '404',
    component: { render() { return '404' } }
  },
  {
    path: '/',
    component: Layout, // 布局组件作为一级路由
    redirect: '/index',
    children: menuRoutes,
    meta: {
      title: '首页'
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
